CountEqual Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Counts the number of items in the collection that are equal to find.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static int CountEqual<T>(
	IEnumerable<T> collection,
	T find,
	IEqualityComparer<T> equalityComparer
)
Visual Basic (Declaration)
Public Shared Function CountEqual(Of T) ( _
	collection As IEnumerable(Of T), _
	find As T, _
	equalityComparer As IEqualityComparer(Of T) _
) As Integer
Visual C++
public:
generic<typename T>
static int CountEqual (
	IEnumerable<T>^ collection, 
	T find, 
	IEqualityComparer<T>^ equalityComparer
)

Parameters

collection
IEnumerable<(Of <T>)>
The collection to count items in.
find
T
The item to compare to.
equalityComparer
IEqualityComparer<(Of <T>)>
The comparer to use to determine if two items are equal. Only the Equals member function will be called.

Return Value

The number of items in the collection that are equal to find.

Type Parameters

T

Exceptions

ExceptionCondition
System..::ArgumentExceptioncollection or equalityComparer is null.

See Also